<template>
	<view>
		<uni-forms ref="baseForm" :model="baseFormData" :rules="rules">
			<uni-forms-item label="姓名" required name="name">
				<uni-easyinput
					v-model="baseFormData.name"
					placeholder="请输入姓名"
				/>
			</uni-forms-item>
			<uni-forms-item label="密码" required>
				<uni-easyinput
					v-model="baseFormData.password"
					placeholder="请输入密码"
				/>
			</uni-forms-item>
		</uni-forms>
		<button type="primary" size="mini" @click="submit()">提交</button>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	const rules=ref({
		name:{
			rules:[
				{
					required:true,
					errorMessage:'请输入姓名',
					trigger:'blur'
				}
			]
		}
	})
	const baseForm = ref()
	const submit=()=>{
		baseForm.value.validate()
	}
	const baseFormData = ref({
		name: '',
		password: '',
	})
</script>

<style lang="scss">
	page {
		padding: 30rpx;
		box-sizing: border-box;
	}

	.rows {
		margin: 30rpx;
	}

	.swipe-box {
		height: 100rpx;
		line-height: 100rpx;
		background-color: #f6f6f6;
	}

	.badge-box {
		width: 100rpx;
		height: 100rpx;
		background-color: #f6f6f6;
	}
</style>
